import axios from 'axios'
export default {
   getData(){
      return (dispatch)=>{
         axios.get("/my/hao123_api/news/getrootdata?page=1&channelName=headline").then((res)=>{
            console.log( 'nav:',res.data)
            dispatch({
               type:'DATA',
               navlist:res.data.feeds.feedTabs,
               headertop:res.data.header
            },(error)=>{console.log(error)})
         })
      }
   },
   getId(id){
      return {
         type:'ID',
         id
      }
   },
   getList(page,id){
      return (dispatch)=>{
          axios.get(`/my/hao123_api/news/feed?newIndex=1&size=8&max_id=0&timestamp=1574388934725&page=${page}&id=${id}&city=`).then((res)=>{
              console.log("list:",res.data.data.list)
              dispatch({
                  type:'LIST',
                  infolist:res.data.data.list,
              })
          })
      }
  },
  getSearch(wbk){
      return {
         type:'WBK',
         wbk
      }
  },
}